const express = require("express");
const router = express.Router();

router.put("/", async (req, res) => {
  const { id, name, icon, path, svg, title, sort, father } = req.body;
  await req.db.connection.query(
    "UPDATE menus SET name=?, icon=?, path=?, svg=?, title=?, sort=?, father=? WHERE id=?",
    [name, icon, path, svg, title, sort, father, id]
  );
  res.send({
    success: true,
    msg: "菜单更新成功",
  });
});
module.exports = router;
